<?php
/**
 * This file is part of Task Agile.
 * Task Agile is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 * Task Agile is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Task Agile.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category   TaskAgile
 * @package    Controller
 * @copyright  Copyright (c) 20010-2010 Estrada Virtual (http://estradavirtual.com.br)
 * @license    http://www.gnu.org/licenses/gpl.txt GPLv3
 * @version    $Id$
*/
?>
<h3>Tarefa</h3>
<div id="divFormulario">
    <form action="<?php echo $this->baseUrl() ?>/task/task/save" method="post" name="form" id="form">
        <input type="hidden" name="id" id="id" value="<?php echo $this->task->id ?>" />
<?php
/*
 * @todo ver como mostrar este campo
            <label for="fk_user"><?php echo $this->translate( "fk_user"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            <?php echo $this->formSelect( "fk_user", $this->task->fk_user, array( "id" => "fk_user", "title" => $this->translate("fk_user"), "class" => "required"), $this->users); ?><br />
*/
?>
            <div class="label">
            	<label for="fk_project"><?php echo $this->translate('fk_project'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            </div>
            <div class="form-item">
            	<?php echo $this->formSelect('fk_project', $this->task->fk_project, array('id' => 'fk_project', 'title' => $this->translate('fk_project'), 'class' => 'required'), $this->projects); ?>
            </div><br />

            <div class="label">
            	<label for="name"><?php echo $this->translate( "name"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            </div>
			<div class="form-item">
				<input class="required" type="text" name="name" id="name" value="<?php echo $this->task->name; ?>" title="<?php echo $this->translate( "name"); ?>"  maxlength="70" />
            </div><br />

			<div class="label">
            	<label for="name"><?php echo $this->translate('fk_type_task'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            </div>
            <div class="form-item">
            	<?php echo $this->formSelect('fk_type_task', $this->task->fk_type_task, array('id' => 'fk_type_task', 'title' => $this->translate('fk_type_task'), 'class' => 'required'), $this->typesTasks); ?>
            </div><br />

			<div class="label">
            	<label for="name"><?php echo $this->translate('priority'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            </div>
            <div class="form-item">
            	<?php echo $this->formSelect('priority', $this->task->priority, array('id' => 'priority', 'title' => $this->translate('priority'), 'class' => 'required'), $this->prioritys); ?>
            </div><br />

			<div class="label">
            	<label for="description"><?php echo $this->translate( "description"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label><br />
            </div>
            <div class="form-item">
            	<textarea rows="10" cols="30" class="required" name="description" id="description"><?php echo $this->task->description; ?></textarea>
            </div><br />

			<div class="label">
            	<label for="status"><?php echo $this->translate( "status"); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            </div>
            <div class="form-item">
            	<?php echo $this->formSelect('status', $this->task->status, array('id' => 'status', 'title' => $this->translate('status'), 'class' => 'required'), $this->status); ?>
            </div><br />

            <?php if ($this->task->dt_register) : ?>
	            <div class="label">
	            	<?php echo $this->translate('dt_register'); ?>&nbsp; :
	            </div>
	            <div class="form-item">
	            	<?php echo $this->dateFormat($this->task->dt_register); ?>
	            </div><br />
            <?php endif; ?>
            <?php if ($this->task->dt_finish) : ?>
	            <div class="label">
	            	<?php echo $this->translate('dt_finish'); ?>&nbsp; :
	            </div>
	            <div class="form-item">
	            	<?php echo $this->dateFormat($this->task->dt_finish); ?>
	            </div><br />
            <?php endif; ?>

			<div class="button">
				<input type="submit" name="enviar" id="enviar" value="Gravar" />
			</div>
    </form>
</div>
<script type="text/javascript">
$().ready(function() {
        $('#form').validate({ignoreTitle:true});
    });
</script>